﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="EditProject.aspx.cs" Inherits="Admin_EditProject" %>
    <%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script>
    function readURL(input) {
        //alert(input);
        if (input.files && input.files[0]) {
            var reader = new FileReader();
            reader.onload = function (e) {
                document.getElementById("imgUpload").src = e.target.result;
                //alert(object);
            };
            reader.readAsDataURL(input.files[0]);
            return false;
        }
    }
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <h3 class="page-title">
                    Form Create San Pham </h3>
                <ul class="breadcrumb">
                    <li><a href="#"><i class="icon-home"></i></a><span class="divider">&nbsp;</span></li><li>
                        <a href="#">Form Stuff</a><span class="divider">&nbsp;</span></li><li><a href="#">Form
                            Layouts</a><span class="divider-last">&nbsp;</span></li></ul>
            </div>
        </div>

    <!--Data Grid-->
    <div class="row-fluid  form-horizontal">

        <div class="span12">
            <div class="widget">
                <div class="widget-title">
                    <h4>
                        <i class="icon-group"></i> Tạo San Pham</h4>
                    <span class="tools"><a href="javascript:;" class="icon-chevron-down"></a><a href="javascript:;"
                        class="icon-remove"></a></span>
                </div>
                <div class="widget-body form">
                    <div class="control-group" >
                        <label class="control-label">
                            Tên San pham</label>
                        <div class="controls">
                            <asp:TextBox ID="txtProduct" CssClass="input-xxlarge" runat="server" ></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2"  ControlToValidate="txtProduct" ErrorMessage="*" />       
                        </div>
                    </div>

                    <div class="control-group" >
                        <label class="control-label">
                            Mô tả:</label>
                        <div class="controls">
                           <asp:TextBox ID="txtDescription" CssClass="input-xxlarge" runat="server" ></asp:TextBox>
                           <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1"  ControlToValidate="txtDescription" ErrorMessage="*" />                                            
                        </div>
                    </div>

                    <%--<div class="control-group" >
                        <label class="control-label">
                            Giá :</label>
                        <div class="controls">
                           <asp:TextBox ID="txtPrice" runat="server" ></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" ControlToValidate="txtPrice"
                                        ValidationExpression="\d+" Display="Static" EnableClientScript="true" ErrorMessage="*"
                                        runat="server" />                                  
                        </div>
                    </div>--%>

                     <div class="control-group">
                     <label class="control-label">
                            Loại San Pham:</label>
                            <div class="controls">
                                   <asp:DropDownList runat="server" ID="ddlCat" AutoPostBack="false"></asp:DropDownList>
                            <asp:RequiredFieldValidator   
                                ID="ReqiredFieldValidator1"  
                                runat="server"  
                                ControlToValidate="ddlCat"  
                                ErrorMessage="Select san pham!"  
                                >  
        </asp:RequiredFieldValidator>       
                            </div>   
                    </div>
                    <div class="control-group">
                         <label class="control-label">
                            Upload Image:</label>
                            <div class="controls">
                                <div data-provides="fileupload" class="fileupload fileupload-new">
                                    <input type="hidden"><div style="width: 200px; height: 150px;" class="fileupload-new thumbnail">
                                        <asp:Image alt=""  id="imgUpload" runat="server" /></div>
                                    <div style="max-width: 200px; max-height: 150px; line-height: 20px;" class="fileupload-preview fileupload-exists thumbnail">
                                    </div>
                                    <div>
                                        <%--<span class="btn btn-file"><span class="fileupload-new">Select image</span><span
                                            class="fileupload-exists">Change</span><input type="file" class="default"></span><a
                                                data-dismiss="fileupload" class="btn fileupload-exists" href="#">Remove</a>--%>
                                                </div>
                                </div>
                        <asp:FileUpload runat="server" ID="fuImage"  onchange="readURL(this);"/>
                        
                        <asp:RegularExpressionValidator ID="rexp" runat="server" ControlToValidate="fuImage"
                            ErrorMessage="Only .gif, .jpg, .png, .tiff and .jpeg" ValidationExpression="(.*\.([Gg][Ii][Ff])|.*\.([Jj][Pp][Gg])|.*\.([Bb][Mm][Pp])|.*\.([pP][nN][gG])|.*\.([tT][iI][iI][fF])$)"></asp:RegularExpressionValidator>
                            </div>
                    </div>
                    <div class="control-group">
                    
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            Nội dung:</label>
                            <div class="controls">
                            <FCKeditorV2:FCKeditor ID="txtContent" runat="server" ToolbarSet="Default" Width="98%"
                                Height="450px">
                            </FCKeditorV2:FCKeditor>
                            
                    </div>
                    <div class="control-group">
                        <asp:Label CssClass="control-label error-page" ID="lblMessage" runat="server"></asp:Label>
                    </div>
                </div>
                
                <div class="form-actions">
                    <asp:Button CssClass="btn btn-success" type="submit" Text="Save" runat="server" 
                        ID="btnSave" onclick="btnSave_Click" />
            </div>
        </div>
                
    </div>
    </div>
</div>
</div>
</asp:Content>